package com.linkage.common.constant;

/**
 * describe: 服务内部常量类
 *
 * @author shaofeng.cheng
 * @date 2020/04/19
 */
public class CommonSysConstant {

    public static final String CODE_ONE = "1";
    public static final String CODE_NINE = "9";
    public static final String CODE_ZERO = "0";
    public static final String CODE_TWO = "2";
    public static final String CODE_SIX = "6";

    public static final String SUCCESS_MSG = "成功！";

    // 人员类型    (0群众 1保安 2警察,3超级管理员 4. 一级管理员  5.二级管理员 6 自建人员 9 运营商)
    public static final String PERSON_CLASS_ZERO = "0";
    public static final String PERSON_CLASS_ONE = "1";
    public static final String PERSON_CLASS_TWO = "2";
    public static final String PERSON_CLASS_THREE = "3";
    public static final String PERSON_CLASS_FOUR = "4";
    public static final String PERSON_CLASS_FIVE = "5";
    public static final String PERSON_CLASS_SIX = "6";
    public static final String PERSON_CLASS_NINE = "9";

    public static final String DEFAULT_PASSWORD = "888888";


//    ORG-001	后台管理机构
//    ORG-002	警察管理机构
//    ORG-003	管理机构
//    ORG-004	群众管理机构
//    ORG-005	企业管理机构
//    ORG-006	自建管理机构
//    ORG-009	散户管理机构
    public static final String ORG_CODE_POLICE = "ORG-002";
    public static final String ORG_CODE_SECURITY = "ORG-003";
    public static final String ORG_CODE_MASS = "ORG-004";
    public static final String ORG_CODE_TYPE_5 = "ORG-005";
    public static final String ORG_CODE_TYPE_9 = "ORG-009";
    public static final String ORG_CODE_TYPE_6 = "ORG-006";
    public static final String ORG_CODE_ALL = "ORG-ALL";
    //未绑定机构代码
    public static final String UNKNOW_DPT_CODE = "UNKNOW-DPT";
    public static final String UNKNOW_DPT_NAME = "无机构";


    //第三方成功代码
    public static final String THIRD_SUCCESS_CODE = "0000";

    //默认页数
    public static final Integer DEFAULT_PAGE_NO = 1;
    //默认页容量
    public static final Integer DEFAULT_PAGE_SIZE = 10;

//    (0群众 1保安 2警察,3超级管理员 4. 一级管理员  5.二级管理员)
    public static final String PERSON_QZ_FLAG = "QZ-0";
    public static final String PERSON_BA_FLAG = "BA-1";
    public static final String PERSON_JC_FLAG = "JC-2";
    public static final String PERSON_CJGLYFLAG = "CJGLY-3";
    public static final String PERSON_GLY12_FLAG = "GLY-45-4";
    public static final String PERSON_YY_FLAG = "YY-6";
    public static final String PERSON_QT_FLAG = "QT-9";

    //TOCKEN前缀  TOKEN:PERSON_QZ_FLAG:DPTCODE:USERCODE:
    public static final String PERSON_TOKEN = "TOKEN";
    public static final String PERSON_TOKEN_SEP_CHAR = ":";

    //OPR-9009	运营商
    public static final String OPR_CODE_YYS = "OPR-9009";

//    20210130	运营商权限分组    ROLE-002
    public static final String ROLE_CODE_YYS = "ROLE-002";


    public static String getTokenUserTypeByPersonClass(String personClass){
        String personClassType = "";
//        String personFlag = "";
        switch (personClass){
            case "0":
                personClassType = CommonSysConstant.PERSON_QZ_FLAG;
                break;
            case "1":
                personClassType = CommonSysConstant.PERSON_BA_FLAG;
                break;
            case "2":
                personClassType = CommonSysConstant.PERSON_JC_FLAG;
                break;
            case "3":
                personClassType = CommonSysConstant.PERSON_CJGLYFLAG;
                break;
            case "4":
                personClassType = CommonSysConstant.PERSON_GLY12_FLAG;
                break;
            case "5":
                personClassType = CommonSysConstant.PERSON_GLY12_FLAG;
                break;
            case "9":
                personClassType = CommonSysConstant.PERSON_YY_FLAG;
                break;
            default:
                personClassType = CommonSysConstant.PERSON_QT_FLAG;
        }
        return  personClassType;
    }

}
